//
// Created by ✎﹏ℳ๓独赏 ☆独醉 on 2023/3/1.
//
#include <stdio.h>
#include <string.h>
//打印杨辉三角形。
//1
//1 1
//1 2 1
//1 3 3 1
//1 4 6 4 1
int main(){
    int arr[5][5];
    int i,j;
    memset(arr,0,sizeof arr);
    for(i=0;i<=4;i++){
        for(j=0;j<=i;j++){
            if(i == j || j == 0){
                arr[i][j]=1;
            }else{
                arr[i][j] = arr[i-1][j-1]+arr[i-1][j];
            }
        }
    }
    for(i=0;i<=4;i++){
        for(j=0;j<=i;j++){
            printf("%d ",arr[i][j]);
        }
        printf("\n");
    }
    return 0;
}